#include "GroupFinishedJob.h"

namespace GPUCC
{
	GroupFinishedJob::GroupFinishedJob(Scanner& Scanner, BaseScanGroup* Group) : m_Scanner(Scanner), m_Group(Group)
	{
	}

	GroupFinishedJob::~GroupFinishedJob()
	{
	}

	void GroupFinishedJob::Run()
	{
		unsigned int GroupSize = this->m_Group->GetItemsCount();

		this->m_Scanner.m_GroupsCS.Enter();

		this->m_Group->Clear();

		this->m_Scanner.m_GroupsCS.Leave();

		this->m_Scanner.m_GroupsLimits.Release(GroupSize);
	}
}